GuiUtils = class('GuiUtils'):include(Stateful)

function GuiUtils:initialze()

end

function GuiUtils:labeledSlider(title, x, y, width, minRange, maxRange, labels, parent)
	--main label
	local mf = loveframes.Create("frame", parent)	
	mf:SetPos(x, y)
	mf:SetName(title)
	mf:SetSize(width+110, 75)
	mf:ShowCloseButton(false)
	mf:SetDraggable(false)

	-- slider
	local s = loveframes.Create("slider", mf)
	s:SetX(10)
	s:CenterY()
	s:SetWidth(width)
	s:SetMinMax(minRange, maxRange)
	local default_value = lume.round((maxRange-minRange)/2)
	if game.debug then default_value = 1 end
	s:SetValue(default_value)	
	s.labels = labels
	s.OnRelease = function(object)
		local val = object:GetValue()
		val = lume.round(val)
		object:SetValue(val)
		object.label:SetText(object.labels[val])
		
	end
	-- slider label (set text on slider not currently working)
	s.label = loveframes.Create("text", mf)
	s.label:SetX(width+20)
	s.label:CenterY()
	s.label:SetText(labels[s:GetValue()])
	return s

end